package com.glory.huaweipda.adapter

import android.graphics.Color
import android.widget.TextView
import androidx.databinding.BindingAdapter


object TextAdapter {

    @BindingAdapter(value = ["textFile"])
    @JvmStatic
    fun setBitmap(text: TextView, color: String) {

        when(color){
            "red" ->{
                text.setTextColor(Color.parseColor("#FF0000"))
            }
            "green" ->{
                text.setTextColor(Color.parseColor("#00FF00"))
            }
            "black" ->{
                text.setTextColor(Color.parseColor("#1C1C1C"))
            }
            "" ->{
                text.setTextColor(Color.parseColor("#1C1C1C"))
            }
        }
    }

}